<template>
  <div class="h100">
    <el-row>
      <nest-tree active-route="Money"></nest-tree>
      <div class="layout-container">
        <router-view v-if="routePath && routePath.meta && routePath.meta.activePath" :key="routePath.meta.activePath"></router-view>
      </div>
    </el-row>
  </div>
</template>

<script>
import { reactive, toRefs, computed, onMounted, nextTick } from 'vue'
import { storeToRefs } from 'pinia';
import { useThemeConfig } from '/@/stores/themeConfig';
import NestTree from '/@/components/nestTree/index.vue';
import { useRoute } from 'vue-router'
export default {
  name: 'MoneyIndex',
  components: {
    NestTree
  },
  setup() {
    const storesThemeConfig = useThemeConfig();
    const { themeConfig } = storeToRefs(storesThemeConfig);
    const route = useRoute()
    const state = reactive({
      refreshRouterViewKey: null,
      routePath: {}
    })
    // 设置主界面切换动画
    const setTransitionName = computed(() => {
      return themeConfig.value.animation;
    });
    onMounted(() => {
      nextTick(() => {
        state.routePath = route
      })
    })
    return {
      ...toRefs(state),
      setTransitionName
    }
  }
}
</script>

<style scoped lang="scss">
.h100{
  min-height: 100vh;
}

.layout-container{
  flex: 1;
  overflow: auto;
  height: 100vh;
  ::-webkit-scrollbar {
    width: 7px;
    height: 7px;
  }
}
</style>
